n = int(input().split()[0])
a = [[0 for i in range(0, 100)] for j in range(0, 100)]
x = 1
y = n // 2 + 1
a[x][y] = 1
for i in range(2, n * n + 1):
	if x == 1 and y != n:
		x = n
		y = y + 1
	elif y == n and x != 1:
		y = 1
		x = x - 1
	elif x == 1 and y == n:
		x = x + 1
	else:
		if a[x - 1][y + 1] == 0:
			x = x - 1
			y = y + 1
		else :
			x = x + 1
#	print(x, y, i)
	a[x][y] = i

for i in range(1, n + 1):
	for j in range(1, n):
		print(a[i][j], end = ' ')
	print(a[i][n])
